package com.fzu.commonutil.mapper;

import com.fzu.commonutil.entity.Resource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zyq
 * @since 2023-04-11
 */
public interface ResourceMapper extends BaseMapper<Resource> {

    /**
     * 根据父级ID获取资源列表
     * @param parentId
     * @return
     */
    @Select("select * from resource where parent_id = #{parentId} order by seq")
    List<Resource> listByParentId(@Param("parentId") Integer parentId);

}
